package abd.pr1.main;

import java.beans.PropertyVetoException;

import javax.sql.DataSource;

import abd.pr1.Controllers.LoginController;
import abd.pr1.Interface.LoginWindow;

import com.mchange.v2.c3p0.ComboPooledDataSource;


public class Main {

	public static void main(String[] args) {
		
		DataSource ds;
		try {
			ComboPooledDataSource con = new ComboPooledDataSource();
			con.setDriverClass("org.gjt.mm.mysql.Driver");
			con.setJdbcUrl("jdbc:mysql://localhost/practica1");
			con.setUser("root");
			con.setPassword("");
			con.setAcquireRetryAttempts(1);
			con.setAcquireRetryDelay(1);
			con.setBreakAfterAcquireFailure(true);
			ds = con;
			
			new LoginController(new LoginWindow(), ds);
			
		} catch (PropertyVetoException e){
			e.printStackTrace();
		}
		
		
	}

}
